home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / WFC010.ZIP / INCLUDE / CNETRSRC.HPP < prev    next >
C/C++ Source or Header  |  1995-12-07  |  3KB  |  101 lines

  1. #if ! defined( NET_RESOURCE_CLASS_HEADER )
  2.  
  3. /*
  4. ** Author: Samuel R. Blackburn
  5. ** CI$: 76300,326
  6. ** Internet: sammy@sed.csc.com
  7. **
  8. ** You can use it any way you like as long as you don't try to sell it.
  9. **
  10. ** Any attempt to sell WFC in source code form must have the permission
  11. ** of the original author. You can produce commercial executables with
  12. ** WFC but you can't sell WFC.
  13. **
  14. ** Copyright, 1995, Samuel R. Blackburn
  15. **
  16. ** $Workfile: $
  17. ** $Revision: $
  18. ** $Modtime: $
  19. */
  20.  
  21. #define NET_RESOURCE_CLASS_HEADER
  22.  
  23. class CNetworkResourceInformation : public CObject
  24. {
  25.    DECLARE_SERIAL( CNetworkResourceInformation )
  26.  
  27.    private:
  28.  
  29.       void m_Initialize( void );
  30.  
  31.    public:
  32.  
  33.       CNetworkResourceInformation();
  34.       CNetworkResourceInformation( const NETRESOURCE *source );
  35.       CNetworkResourceInformation( const CNetworkResourceInformation& source );
  36.  
  37.       virtual ~CNetworkResourceInformation();
  38.  
  39.       /*
  40.       ** Patterned after NETRESOURCE
  41.       */
  42.  
  43.       CString   LocalName;
  44.       CString   RemoteName;
  45.       CString   Comment;
  46.       CString   Provider;
  47.       DWORD     Scope;
  48.       DWORD     Type;
  49.       DWORD     DisplayType;
  50.       DWORD     Usage;
  51.  
  52.       virtual void Copy( const NETRESOURCE *source );
  53.       virtual void Copy( const CNetworkResourceInformation& source );
  54.       virtual void Empty( void );
  55.       virtual void Serialize( CArchive& archive );
  56. };
  57.  
  58. class CNetworkResources : public CNetwork
  59. {
  60.    DECLARE_DYNAMIC( CNetworkResources )
  61.  
  62.    private:
  63.  
  64.       void m_Initialize( void );
  65.  
  66.    protected:
  67.  
  68.       HANDLE m_ResumeHandle;
  69.  
  70.       NETRESOURCE m_NetResource;
  71.  
  72.    public:
  73.  
  74.       enum Scope {
  75.                     scopeConnected  = RESOURCE_CONNECTED,
  76.                     scopeAll        = RESOURCE_GLOBALNET,
  77.                     scopePersistent = RESOURCE_REMEMBERED
  78.                  };
  79.  
  80.       enum Type  {
  81.                     typeAny   = RESOURCETYPE_ANY,
  82.                     typeDisk  = RESOURCETYPE_DISK,
  83.                     typePrint = RESOURCETYPE_PRINT
  84.                  };
  85.  
  86.       enum Usage {
  87.                     usageAll         = 0,
  88.                     usageConnectable = RESOURCEUSAGE_CONNECTABLE,
  89.                     usageContainer   = RESOURCEUSAGE_CONTAINER
  90.                  };
  91.  
  92.       CNetworkResources();
  93.       CNetworkResources( LPCTSTR machine_name );
  94.       virtual ~CNetworkResources();
  95.  
  96.       virtual BOOL Enumerate( CNetworkResourceInformation& information );
  97.       virtual BOOL GetNext( CNetworkResourceInformation& information );
  98. };
  99.  
  100. #endif // NET_RESOURCE_CLASS_HEADER
  101.